#!/bin/bash -e

declare dir="$(dirname $0)/../work"
cat ${dir}/jabberwocky.hex | sed -e "s,:\([0-9A-F]\{2\}\)\([0-9A-F]\{4\}\)\([0-9A-F]\{2\}\).*,a[\3]+=\1; ," | tr -d '\n' | sed -e "s,^,ibase=16; ," -e "s,$,a[00]\n," | bc
# | tr '\n' '+'
# | sed -e "s,10+10+,20+,g" -e "s,20+20+,40+,g" -e "s,40+40+,80+,g" -e "s,80+80+,100+,g" -e "s,100+100+,200+,g" -e "s,200+200+,400+,g" -e "s,400+400+,800+,g"

